package org.zhadoop.stream.cql.semanticanalyzer.parser.visitor;

import org.antlr.v4.runtime.misc.NotNull;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.DatasourceBodyContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.StreamBodyContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.context.FromSourceContext;

/**
 * from 语法遍历
 * @author zwd
 *
 */
public class FromSourceVisitor extends AbsCQLParserBaseVisitor<FromSourceContext>{

	private FromSourceContext context = null;
	
	public FromSourceVisitor() {
		context = new FromSourceContext();
	}
	
	@Override
	protected FromSourceContext defaultResult() {
		return context;
	}
	
	@Override
	public FromSourceContext visitStreamBody(@NotNull StreamBodyContext ctx) {
		StreamBodyVisitor visitor = new StreamBodyVisitor();
        context.setStreamBody(visitor.visit(ctx));
        return context;
	}
	
	@Override
	public FromSourceContext visitDatasourceBody(@NotNull DatasourceBodyContext ctx) {
		DatasourceBodyVisitor visitor = new DatasourceBodyVisitor();
        context.setDataSoruceBody(visitor.visit(ctx));
        return context;
	}

}
